package com.epam.command.load;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.epam.command.logic.Command;
import com.epam.command.logic.LoaderLogic;
import com.epam.util.ConfigurationManager;

public class LoadPurchasesCommand implements Command {
	
	@Override
	public String execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		HttpSession session = request.getSession();
		String page = ConfigurationManager.getConfig(ConfigurationManager.PURCHASES);
		String login = (String) session.getAttribute("login");
				
		request.setAttribute("purchases", LoaderLogic.loadPurchases(login));
		
		
		return page;
		
	} 

	
	
}
